package cn.hhz._mybatis.mapper;

import cn.hhz._mybatis.pojo.entity.Weibo;
import cn.hhz._mybatis.pojo.vo.ResultMapV01;
import cn.hhz._mybatis.pojo.vo.ResultMapv02;
import cn.hhz._mybatis.pojo.vo.SelectWeiboV01;
import cn.hhz._mybatis.pojo.vo.Selectweibov02;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface WeiboMapper {

   // @Insert("INSERT INTO weibo(content,created,user_id) VALUES (#{content},#{date},#{user_id})")
    int insertweibo(Weibo weibo);

   // @Delete("DELETE From weibo WHERE id = #{weiboid}")
    int deleteWeibo(Long weiboid);

   // @Update("UPDATE weibo SET content=#{content},created=#{date},user_id=#{user_id} WHERE id=#{id}")
    int updateWeibo(Weibo weibo);

   // @Select("SELECT id,content,created date,user_id FROM weibo WHERE id=#{weiboid}")
    Weibo selectweiboByID(Long weiboID);

  //  @Select("SELECT id,content,created date,user_id FROM weibo")
    List<Weibo> selectWeibo();

  //  @Select("SELECT content,created FROM weibo WHERE id=#{id}")
    SelectWeiboV01 selectWeibov01(Long id);

//    @Select("SELECT id,content FROM weibo WHERE user_id=#{id}")
    List<Selectweibov02> selectWeibov02(Long id);

    int dyUp(Weibo weibo);

    int dynDel(Long[] weibo);

    int dynDel1(List<Long> ids);

    int selectCount();

    ResultMapV01 selectResultMap(Long weiboid);

    ResultMapv02 selectResultMap2(Long id);
}
